<?php
namespace app\api\validate;

use think\Validate;

class Web extends Validate
{
    protected $rule =   [
        'title'  => 'require',
        'tpic'  => 'require',
        'content'  => 'require',
        'active_time'  => 'require',
        'active_status'  => 'require',
        'active_pos'  => 'require',
        'username'  => 'require',
        'tel'  => 'require',
        'job'  => 'require',
        'school'  => 'require',
        'from'  => 'require',
        'name'  => 'require',
        'desc'  => 'require',
        // law
        'country'  => 'require',
        'patent_desc'  => 'require',
        'patent_apply'  => 'require',
        'patent_litigation'  => 'require',
        'patent_objection'  => 'require',
        'trademark_apply'  => 'require',
        'trademark_litigation'  => 'require',
        'trademark_objection'  => 'require',
        // product
        'company_id' => 'require',
        'type' => 'require',
        'prize' => 'require',
        'patent_list' => 'require',
        'advantage' => 'require',
        'prizeArr' => 'require',

        // 海外智联体
        'email' => 'require|email',
        'phone' => 'require',
        'address' => 'require',

        // 领域
        'realm' => 'require',

        // 顺德荣誉
        'years' => 'require',
        'prize_name' => 'require',

        'file' => 'require',
        'year' => 'require|number',
        'month' => 'require|number',

        'active_id' => 'require|number',
        'remark' => 'require',

    ];

    protected $message  =   [
        'title.require' => '标题必须填写',
        'tpic.require' => '未上传封面图',
        'content.require' => '内容必须填写',
        'active_time.require' => '活动时间必须填写',
        'active_pos.require' => '活动地址必须填写',
        'username.require' => '联系人必须填写',
        'tel.require' => '联系方式必须填写',
        'job.require' => '职位必须填写',
        'school.require' => '所属院校必须填写',
        'from.require' => '研究方向必须填写',
        'name.require' => '名称必须填写',
        'desc.require' => '简介或介绍不能为空',
        // law
        'country.require' => '国家必须选择',
        'patent_desc.require' => '专利概述必须填写',
        'patent_apply.require' => '专利申请必须填写',
        'patent_litigation.require' => '专利诉讼必须填写',
        'patent_objection.require' => '专利异议必须填写',
        'trademark_apply.require' => '商标申请必须填写',
        'trademark_litigation.require' => '商标诉讼必须填写',
        'trademark_objection.require' => '商标异议必须填写',
        // product
        'company_id.require' => '未选择单位',
        'type.require' => '未选择分类',
        'prize.require' => '未选择奖项',
        'patent_list.require' => '未填写核心专利',
        'advantage.require' => '未填写产品优势',
        'prizeArr.require' => '未选择奖项',

        'realm.require' => '未选择领域',

        'pno.require' => '未填写专利号',
        'team.require' => '未选择团队',


        'years.require' => '未填写年份',
        'prize_name.require' => '未填写奖项名称',

        'file.require' => '未上传文件',

        'active_id.require' => '活动id未选中',


    ];

    protected $scene = [
        'liusongjing'=>['title'],
        'news'  =>  ['title', 'tpic', 'content'],
        'policy'  =>  ['title', 'type', 'content'],
        'report'  =>  ['title', 'type', 'content'],
        'activity'  =>  ['title', 'tpic', 'content'],
        // 'activity'  =>  ['title','tpic', 'content', 'active_time', 'active_pos', 'username', 'tel'],
        'project'  =>  ['name', 'content', 'from', 'school', 'job'],
        'law_1'  =>  ['country', 'patent_desc', 'patent_apply', 'patent_litigation'],
        'law_2'  =>  ['country', 'trademark_apply'],
        'law_3'  =>  ['country', 'content'],
        'company'  =>  ['name', 'tpic', 'desc'],
        'honor_trademark'  =>  ['name', 'href'],
        'honor_patent'  =>  ['name', 'ano', 'company', 'years', 'prize_name'],
        'excellent_company'  =>  ['company_id'],
        'banner'  =>  ['tpic'],
        'product'  =>  ['title', 'tpic', 'company_id', 'type', 'prizeArr', 'patent_list', 'desc', 'advantage'],
        'examples_company'  =>  ['name', 'years'],


        // 2021-08-31
        // 海外最新政策
        'overseas_policy'  =>  ['title', 'content'],
        
        // 2021-09-09
        // 海外智联体
        'overseas_smart'  =>  ['company', 'country', 'content'],
        'overseas_analysis'  =>  ['title', 'tpic'],

        // 2021-09-10
        // 标签管理
        'label'  =>  ['name'],

        // 2021-09-13
        // 优秀团队
        'excellent_team'  =>  ['name', 'tpic', 'realm', 'school', 'desc'],
        // 优秀专利
        'excellent_patent'  =>  ['pno', 'realm', 'school', 'team'],

        // 2021-9-14
        'highserver'  =>  ['title','phone','address'],
        'knowledge'  =>  ['title','tpic','content'],
        'scientific'  =>  ['title','tpic','content'],

        'honor_landmark'  =>  ['name', 'tpic', 'desc'],

        // 2021-09-15
        // 对话顺德
        'honor_dialogue'  =>  ['title', 'tpic', 'content'],

        // 知识产权动态
        'dynamic'  =>  ['title', 'year', 'file'],


        // 活动报名
        'active_sign' => ['name', 'phone', 'active_id'],
        // 咨询表单
        'consult' => ['name','phone','remark'],
        


    ];   

}